﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BizScore;
using System.Collections.Generic;
using System.Linq;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest3
    {
        [TestMethod]
        public void TestMethod1()
        {
            List<BizScore.Model.ExamScore> listTest = new List<BizScore.Model.ExamScore>();


            BizScore.Model.ExamScore exam = new BizScore.Model.ExamScore();
            exam.PostID = "290100003";
            exam.Total = 220.0f;
            listTest.Add(exam);

            exam = new BizScore.Model.ExamScore();
            exam.PostID = "290100003";
            exam.Total = 222.0f;
            listTest.Add(exam);


            exam = new BizScore.Model.ExamScore();
            exam.PostID = "290100003";
            exam.Total = 222.0f;
            listTest.Add(exam);

            exam = new BizScore.Model.ExamScore();
            exam.PostID = "290100002";
            exam.Total = 221.0f;
            listTest.Add(exam);


            exam = new BizScore.Model.ExamScore();
            exam.PostID = "290100001";
            exam.Total = 220.0f;
            listTest.Add(exam);

            exam = new BizScore.Model.ExamScore();
            exam.PostID = "290100001";
            exam.Total = 230.0f;
            listTest.Add(exam);


            //var values =
            //    from t in listTest
            //    orderby t.PostID, t.Total descending
            //    select t;

            var values =
               from t in listTest
               group t by t.PostID into nT
               orderby nT.Key
               select new
               {
                   K1 =
                   from t1 in nT
                   orderby t1.Total descending
                   select t1

               };

            var list = values.ToArray();

        }


        [TestMethod]
        public void TestMethod2()
        {

          
        }


        [TestMethod]
        public void TestMethod3()
        {
            
        }
    }
}
